package com.backstage.employeeModule.service.impl;

import com.backstage.employeeModule.pojo.Employee;
import com.backstage.employeeModule.mapper.EmployeeMapper;
import com.backstage.employeeModule.service.EmployeeService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * `Mobile_end_Employee` 服务实现类
 * </p>
 *
 * @author liu-xiang
 * @since 2022-12-13
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {
  @Autowired
  private EmployeeMapper employeeMapper;

  @Override
  public Employee login(String username, String password) {
    LambdaQueryWrapper<Employee> wrapper = new LambdaQueryWrapper<>();
    wrapper.eq(Employee::getUsername,username).eq(Employee::getPassword,password);
    Employee emp = employeeMapper.selectOne(wrapper);
    return emp;
  }
}
